const log = console.log;
class PrintChar {
  constructor(char, count) {
    this.char = char;
    this.count = count;
  }
  for1() {
    let pChar = this.char;
    for (let i = 0; i < this.count; i++) {
      log(pChar);
      pChar += this.char;
    }
  }
  for2 () {
    let pChar = this.char;
    for (let i = this.count; i > 0; i--) {
      pChar = this.char;
      for (let j = 0; j < i - 1; j++) {
        pChar += this.char;
      }
      log(pChar);
    }
  }
  for3 () {
     let pChar = this.char;
     for (let i = this.count; i > 0; i--) {
       pChar = this.char;
       if ((i + 1) % 2) { // 打印基数行 从11开始
         for (let j = 0; j < i - 1; j++) {
           pChar += this.char;
         }
         log(pChar);
       }
     }
   }
   var p = new PrintChar("A", 10);
p.for1();
log("--------------");
p.for2();
log("--------------");
p.for3();
log("--------------");
